local skel = fk.CreateSkill {
  name = "emo__zangsheng",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["emo__zangsheng"] = "葬生",
  [":emo__zangsheng"] = "锁定技，每当你使用牌指定唯一目标后，此牌额外结算X次（X为其逆时针至你路径上的死亡角色数）。",
}

skel:addEffect(fk.TargetSpecified, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(skel.name) and data.to and data.to ~= player
    and data:isOnlyTarget(data.to) and data.firstTarget then
      local temp = data.to.next
      while temp ~= data.to do
        if temp.dead then return true end
        temp = temp.next
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local n = 0
    local temp = data.to.next
    while temp ~= data.to do
      if temp.dead then n = n + 1 end
      temp = temp.next
    end
    data.use.additionalEffect = (data.use.additionalEffect or 0) + n
  end,
})

return skel
